﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace _03_DNSLookup
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: GetDNSHostInfo hostname");
                args = new String[] { "mai.ru" };
                //return;
            }
            IPHostEntry results = Dns.GetHostEntry(args[0]);
            Console.WriteLine("Host name: {0}",
                     results.HostName);
            foreach (string alias in results.Aliases)
            {
                Console.WriteLine("Alias: {0}", alias);
            }
            foreach (IPAddress address in results.AddressList)
            {
                Console.WriteLine("Address: {0}",
                      address.ToString());
            }

            Console.ReadLine();
        }
    }
}
